package cn.com.dhc.danlu.fragment.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.umeng.analytics.MobclickAgent;

import cn.com.dhc.danlu.fragment.bridge.FragmentBridge;
import cn.com.dhc.danlu.fragment.bridge.FragmentBridge.OnFragmentBrigdeListener;
import cn.com.dhc.danlu.util.AgentUtils;

/**
 * @author wuhaiyang
 */
public class BaseBridgeFragment extends Fragment {

    protected FragmentBridge.OnFragmentBrigdeListener mBridgeCallback;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        try {
            mBridgeCallback = (OnFragmentBrigdeListener) context;
        } catch (Exception e) {
            throw new RuntimeException(context.getClass().getSimpleName() + "must imp OnFragmentBridgeListener");
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart(AgentUtils.getPackageInfo(getActivity()).packageName);

    }

    @Override
    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd(AgentUtils.getPackageInfo(getActivity()).packageName);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}